/* $Header: iomap.h,v 2.2 01/10/02 10:30:26 przybyls Exp $ */

/***********************************************************************/
/* INCLUDE FILE NAME: iomap.h                                          */
/* ==================                                                  */
/*                                                                     */
/* Authors:      Lesley Freed                                          */
/*                                                                     */
/* COMMENT:  This is an include file which declares all of the         */
/*           hardware addresses and bit positions for Jack.            */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

#ifndef IOMAP_H
#define IOMAP_H

#define OVEN_ON_MASK            0x02    /* Mask to turn OVEN on            */

#define SPLIT_VLVA_ON           0x10    /* Mask to turn Split Valve A ON    */
#define SPLIT_VLVB_ON           0x20    /* Mask to turn Split Valve B ON    */

#define SPLIT_VLVA_OFF          0xef    /* Mask to turn Split Valve A ON    */
#define SPLIT_VLVB_OFF          0xdf    /* Mask to turn Split Valve B ON    */

#define VALVE1_OFF              0xf7    /* Mask off for 24 V valve #1        */
#define VALVE2_OFF              0xef    /* Mask off for 24 V valve #2        */
#define VALVE3_OFF              0xdf    /* Mask off for 24 V valve #3        */
#define VALVE4_OFF              0xbf    /* Mask off for 24 V valve #4        */

#define VALVE1_ON               0x08    /* Mask on for 24 V valve #1         */
#define VALVE2_ON               0x10    /* Mask on for 24 V valve #2         */
#define VALVE3_ON               0x20    /* Mask on for 24 V valve #3         */
#define VALVE4_ON               0x40    /* Mask on for 24 V valve #4         */

#define RELAY1_ON               0x01    /* Mask to turn Relay #1 ON         */
#define RELAY2_ON               0x02    /* Mask to turn Relay #2 ON         */

#define VLV24_1_ON              0x04    /* Mask to turn 24 V Valve #1 ON    */
#define VLV24_2_ON              0x08    /* Mask to turn 24 V Valve #2 ON    */

#define PNEU_BD_PRESENT         0x80    /* Pneumatics Board Present     */


#define BEEP_1KHZ_MASK          0x02   /* OR mask to set 1KHz freq    */
#define BEEP_512_MASK           0x00   /* OR  mask to set 512 Hz freq */


#define DETA_BD_ON              0x01    /* Turn on Detector A            */
#define DETB_BD_ON              0x02    /* Turn on Detector B            */
#define DETA_INPUT4_ON          0x04    /* DETA pin #A3 */
#define DETA_INPUT5_ON          0x08    /* DETA pin #A7 */
#define CPFA_BD_ON              0x08    /* Turn on CPF BRD A - Front     */
#define DETB_INPUT4_ON          0x10    /* DETB pin #A3 */
#define DETB_INPUT5_ON          0x20    /* DETB pin #A7 */
#define CPFB_BD_ON              0x20    /* Turn on CPF BRD B - Back      */


/* On Masks for Detector A/B Config: DISCRETE_OUT2 */

#define DETA_INPUT0_ON          0x01    /* DETA pin #C4 */
#define DETA_INPUT_DISABLE_ON   0x01

#define DETA_INPUT1_ON          0x02    /* DETA pin #B4 */
#define DETA_FID_IGNITOR_ON     0x02
#define DETA_FPD_IGNITOR_ON     0x02
#define DETA_ECD_N2_ON          0x02
#define DETA_NPD_BEAD_ON        0x02
#define DETA_TCD_VALVE_ON       0x02    /* only functions when input disabled */

#define DETA_INPUT2_ON          0x04    /* DETA pin #A4 */
#define DETA_TCD_N2_Ar_ON       0x04

#define DETA_INPUT3_ON          0x08    /* DETA pin #C3 */
#define DETA_TCD_HI_FILAMENT_TEMP_ON  0x08

#define DETB_INPUT0_ON          0x10    /* DETB pin #C4 */
#define DETB_INPUT_DISABLE_ON   0x10

#define DETB_INPUT1_ON          0x20    /* DETB pin #B4 */
#define DETB_FID_IGNITOR_ON     0x20
#define DETB_FPD_IGNITOR_ON     0x20
#define DETB_ECD_N2_ON          0x20
#define DETB_NPD_BEAD_ON        0x20
#define DETB_TCD_VALVE_ON       0x20    /* only functions when input disabled */

#define DETB_INPUT2_ON          0x40    /* DETB pin #A4 */
#define DETB_TCD_N2_Ar_ON       0x40

#define DETB_INPUT3_ON          0x80    /* DETB pin #C3 */
#define DETB_TCD_HI_FILAMENT_TEMP_ON  0x80
/* Read/Writable memory locations */

#define RAM     0x300000
#define RAM_END 0x3fffff

#define IO_MIN   0x400000
#define IO_MAX   0x4fffff

/* start of DRAM memory */
#define DMA_MEM   0x00//0x0312000
#define DRAM_MIN  DMA_MEM
#define DRAM_MAX  DMA_MEM+0xedbff

extern INT8   ZONES_CONFIG2;       //in include/iomap.h
extern INT8   DISCRETE_IN1;        //in include/iomap.h
extern INT8   APG_BUS_IN;          //in include/iomap.h
extern INT8   APG_BUS_OUT;         //in include/iomap.h
extern INT8   DSP_BOOT;            //in include/iomap.h
extern INT8 DETECTOR_IN;           //in include/iomap.h
extern INT8 DISCRETE_IN2;          //in include/iomap.h
extern INT8 BCD_IN;                //in include/iomap.h
extern INT8 KEYBOARD;              //in include/iomap.h
extern INT8 ZONES_CONFIG1;         //in include/iomap.h
extern INT8 RESET_LATCH1;          //in include/iomap.h
extern INT8 ZONES_OUT1;            //in include/iomap.h
extern INT8 ZONES_OUT2;            //in include/iomap.h


#endif
